1003 implement ODE SEIR metapopulation model#1273
1003 implement ODE SEIR metapopulation model#1273charlie0614 wants to merge 124 commits intomainfrom
Conversation
…s-integrated-into-the-odes
…s-integrated-into-the-odes
HenrZu
left a comment
There was a problem hiding this comment.
Great work :) Only some comments, and then we can merge :)
HenrZu
left a comment
There was a problem hiding this comment.
Sorry for the delay. Let's get this done soon. Overall, it looks very good and is an interesting addition. However, we still need to work on the presentation and documentation :)
| As the model is given as a large system of ODEs, the simulation can be performed by solving the system using a standard ODE solver. The model is build on the same setup as the simpler ODE-models, so we refer to :doc:`ode` for more details. | ||
|
|
||
|
|
||
| How to: Set up and run the ODE metapopulation model |
There was a problem hiding this comment.
| How to: Set up and run the ODE metapopulation model | |
| How to: Set up and run the ODE-based metapopulation model |
|
|
||
| auto result = simulate(t0, tmax, dt, model); | ||
|
|
||
| result.print_table(); |
There was a problem hiding this comment.
What is the insight of this output? Maaybe you can output smth more interesting, or at least label the cols.
| const size_t Rjn = population.get_flat_index({Region(region_n), AgeGroup(age_j), Recovered}); | ||
| const size_t Sjn = population.get_flat_index({Region(region_n), AgeGroup(age_j), Susceptible}); | ||
|
|
||
| const double Nj_inv = 1.0 / (pop[Sjn] + pop[Ejn] + pop[Ijn] + pop[Rjn]); |
There was a problem hiding this comment.
similar to the model.h in the locla seir model, we should check if the population is > Limits::zero_tolerance())
| const size_t Sjn = population.get_flat_index({Region(region_n), AgeGroup(age_j), Susceptible}); | ||
|
|
||
| const double Nj_inv = 1.0 / (pop[Sjn] + pop[Ejn] + pop[Ijn] + pop[Rjn]); | ||
| double coeffStoE = 0.5 * |
There was a problem hiding this comment.
This might potentially be a bigger problem. The coeffStoE is independent of the region. Is it possible to choose a region specific damping factor? At the moment, we just have one global contact matrix right?
I think we can solve this using the ContactMatrixGroup and the indices are the regions then.
| { | ||
|
|
||
| /******************** | ||
| * define the model * |
There was a problem hiding this comment.
there is no readme file in this dir.
I think it is important to note there, that is just an implementation of a implicit mobility scheme and that we also have a generic mobility scheme with explicit mobility (the graph-ode) for each of the available ODE models.
| Simulation | ||
| ---------- | ||
|
|
||
| The simulation runs in discrete time steps using standard numerical integration schemes. Several schemes including adaptive step size methods are available, see here. |
| How to: Set up and run a simulation of the deterministic metapopulation model | ||
| ---------------------------------------------------------------------------- | ||
|
|
||
| To set up a simulation with the deterministic SEIR metapopulation model you need to initialize the model with the desired number of regions and age groups, e.g., 3 regions and 1 age group: |
There was a problem hiding this comment.
not sure about the deterministic here.
| model.parameters.template get<mio::oseirmetapop::ContactPatterns<>>() | ||
| .get_cont_freq_mat()[0] | ||
| .get_baseline() | ||
| .setConstant(2.7); | ||
|
|
||
| model.parameters.set<mio::oseirmetapop::TimeExposed<>>(3.335); | ||
| model.parameters.set<mio::oseirmetapop::TimeInfected<>>(8.097612257); | ||
| model.parameters.set<mio::oseirmetapop::TransmissionProbabilityOnContact<>>(0.07333); |
There was a problem hiding this comment.
these parameters are now set global. It would be more interesting to allow them to be set locally.
| model.parameters.set<mio::oseirmetapop::TimeInfected<>>(8.097612257); | ||
| model.parameters.set<mio::oseirmetapop::TransmissionProbabilityOnContact<>>(0.07333); | ||
|
|
||
| Construct an ``Eigen::MatrixXd`` of size :math:`n_{regions} \times n_{regions}` which describes the fraction of individuals commuting from one region to another. The matrix should satify the sum of each row equal to 1.0, e.g.: |
There was a problem hiding this comment.
Theres not real "commuting from one region to another" in this model
| ODE-based metapopulation model | ||
| ================================ | ||
|
|
||
| Introduction |
There was a problem hiding this comment.
just reading the file name, i would assume that this also includes the graph-ode. And whats the difference between the determinnistic_metapop and ode_metapop files?
Changes and Information
Please briefly list the changes (main added features, changed items, or corrected bugs) made:
Replacement for #1128
If need be, add additional information and what the reviewer should look out for in particular:
Merge Request - Guideline Checklist
Please check our git workflow. Use the draft feature if the Pull Request is not yet ready to review.
Checks by code author
Checks by code reviewer(s)